<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>拒绝商家</title>
		<link rel="stylesheet" href="layui/css/layui.css">
		<link rel="stylesheet" href="static/css/style.css">
		<link rel="stylesheet" href="layui/css/layuibtn.css">
	</head>
	<style>
		.roomType {
			display: block!important;
			width: 100%;
			border-color: #D2D2D2!important;
			height: 38px;
			line-height: 1.3;
			border-width: 1px;
			border-style: solid;
			background-color: #fff;
			border-radius: 2px;
			padding-left: 10px;
		}
	</style>

	<body>
		<div class="container">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
				<legend>拒绝商家</legend>
			</fieldset>

			<form class="layui-form" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">商家名称</label>
					<div class="layui-input-block">
						<input type="text" name="name" lay-verify="name" autocomplete="off" placeholder="请输入标题" class="layui-input name" readonly="true" style="color: #ccc;">
					</div>
				</div>
				<!--<div class="layui-form-item">
					<label class="layui-form-label">商家名称</label>
					<div class="layui-input-block">
						<input type="text" name="name" lay-verify="name" autocomplete="off" placeholder="请输入用户名" class="layui-input name">
					</div>
				</div>-->
				<div class="layui-form-item">
					<label class="layui-form-label">拒绝理由</label>
					<div class="layui-input-block">
						<textarea style="width: 100%; height: 200px;" class="reason"></textarea>
						<!--<input type="text" name="phone" lay-verify="phone" autocomplete="off" placeholder="请输入手机号" class="layui-input phone">-->
					</div>
				</div>

				<!--<div class="layui-form-item">
					<label class="layui-form-label">代理区域</label>
					<div class="layui-input-block">
						<input type="text" name="address" lay-verify="address" autocomplete="off" placeholder="请输入密码" class="layui-input address">
					</div>
				</div>-->
				<input type="hidden" class="id" />
				<!--<div class="layui-form-item">
					<label class="layui-form-label">抽成</label>
					<div class="layui-input-block">
						<input type="text" name="proportion" lay-verify="proportion" autocomplete="off" placeholder="请输入密码" class="layui-input proportion">
					</div>
				</div>-->

				<div class="layui-form-item">
					<button type="button" class="layui-btn" onclick="settijiao()">提交</button>
					<button type="button" class="layui-btn" id="quxiao">取消</button>
				</div>
			</form>
		</div>

		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script src="js/common.js"></script>
		<script src="layui/layui.js"></script>
		<script src="layer-v3.1.1/layer/mobile/layer.js"></script>
		<script>
			//$(function() {	
			layui.use(['element', 'layer'], function() {
				var $ = layui.jquery,
					element = layui.element;
				layer = layui.layer;

			});
			//商家id
			var id = getQueryString("id");
			$.ajax({
				type: "post",
				url: baseurl + "/store/addStoreOne",
				data: {
					id: id
				},
				success: function(data) {
					console.log(data)
					$(".id").val(data.data.id);
					$(".name").val(data.data.name);
				}
			});

			$("#quxiao").click(function() {
				window.parent.location.reload();
			})

			function settijiao() {
				$.ajax({
					type: "post",
					url: baseurl + "/store/refuseStatus",
					data: {
						id: $(".id").val(),
						reason: $(".reason").val(),
					},
					success: function(data) {
						console.log(data)
						if(data.meta.code == 200) {
							layer.alert('修改成功', function() {
								window.parent.location.reload();
							});
						} else {
							layer.alert("修改失败" + data.meta.msg);
						}
					}
				})
			}
		</script>
	</body>

</html>